namespace IQIGame.Onigao.Logic
{
    public static class LgLevelConvertUtil
    {
        public static int MillisecToFrame(int milliSec)
        {
            return (int)(milliSec / (float)1000 * LgLevelConst.FrameRate);
        }

        /// <summary>
        /// 把关卡单位（厘米）长度转换成米
        /// </summary>
        /// <param name="levelUnitValue">长度（关卡长度单位）</param>
        /// <returns></returns>
        public static float LevelDistanceToMeter(int levelUnitValue)
        {
            return (float)levelUnitValue / LgLevelConst.DistanceUnitRatio;
        }

        /// <summary>
        /// 把米转换成关卡单位（厘米）长度
        /// </summary>
        /// <param name="meterValue"></param>
        /// <returns></returns>
        public static int MeterToLevelDistance(int meterValue)
        {
            return meterValue * LgLevelConst.DistanceUnitRatio;
        }
    }
}
